package com.agileboot.medicine.controller.system;

import com.agileboot.common.core.dto.ResponseDTO;
import com.agileboot.domain.system.notice.NoticeApplicationService;
import com.agileboot.domain.system.notice.dto.NoticeDTO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/notice")
public class NoticeController {
    @Autowired
    private NoticeApplicationService noticeApplicationService;

    /**
     * 前台获取通知公告
     */
    @Operation(summary = "获取通知公告")
    @GetMapping("/list")
    public ResponseDTO<List<NoticeDTO>> getNoticeList() {
        List<NoticeDTO> noticeDTOList = noticeApplicationService.getNoticeList();
        return ResponseDTO.ok(noticeDTOList);
    }

}
